﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MAction : NState<BattleEntityHero>
{
    public void Enter(BattleEntityHero entity, params object[] args)
    {
        string clipName = args[0] as string;
        bool isLoop = (bool)args[1];
        entity.PlayAction(clipName, isLoop);
        //Debug.LogFormat("EnterMacTion {0}  ",clipName);
    }

    public void Execute(BattleEntityHero entity, params object[] args)
    {
        
    }

    public void Exit(BattleEntityHero entity, params object[] args)
    {
        
    }

    public bool OnMessage(BattleEntityHero entity, MessageBody message)
    {
        //Action 动画结束
        EntityMessageDispatcher.Instance.SendEntity2Node(message.msgId,entity.Id);
        return false;
    }
}
